<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSettingsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('settings', function (Blueprint $table) {
            $table->id()->from(config('migration.from'));
            $table->string('key')->unique()->comment('Ключ');
            $table->jsonb('value')->default(json_encode([]))->comment('Значение');
            $table->boolean('public')->default(false)->comment('Публичная настройка');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::drop('settings');
    }
}
